package com.ruoyi.anfang.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.anfang.mapper.MoAlarmLogMapper;
import com.ruoyi.anfang.domain.MoAlarmLog;
import com.ruoyi.anfang.service.IMoAlarmLogService;

/**
 * 报警记录Service业务层处理
 * 
 * @author wzy
 * @date 2024-07-16
 */
@Service
public class MoAlarmLogServiceImpl implements IMoAlarmLogService 
{
    @Autowired
    private MoAlarmLogMapper moAlarmLogMapper;

    /**
     * 查询报警记录
     * 
     * @param id 报警记录主键
     * @return 报警记录
     */
    @Override
    public MoAlarmLog selectMoAlarmLogById(Long id)
    {
        return moAlarmLogMapper.selectMoAlarmLogById(id);
    }

    /**
     * 查询报警记录列表
     * 
     * @param moAlarmLog 报警记录
     * @return 报警记录
     */
    @Override
    public List<MoAlarmLog> selectMoAlarmLogList(MoAlarmLog moAlarmLog)
    {
        return moAlarmLogMapper.selectMoAlarmLogList(moAlarmLog);
    }

    /**
     * 新增报警记录
     * 
     * @param moAlarmLog 报警记录
     * @return 结果
     */
    @Override
    public int insertMoAlarmLog(MoAlarmLog moAlarmLog)
    {
        moAlarmLog.setCreateTime(DateUtils.getNowDate());
        return moAlarmLogMapper.insertMoAlarmLog(moAlarmLog);
    }

    /**
     * 修改报警记录
     * 
     * @param moAlarmLog 报警记录
     * @return 结果
     */
    @Override
    public int updateMoAlarmLog(MoAlarmLog moAlarmLog)
    {
        moAlarmLog.setUpdateTime(DateUtils.getNowDate());
        return moAlarmLogMapper.updateMoAlarmLog(moAlarmLog);
    }

    /**
     * 批量删除报警记录
     * 
     * @param ids 需要删除的报警记录主键
     * @return 结果
     */
    @Override
    public int deleteMoAlarmLogByIds(Long[] ids)
    {
        return moAlarmLogMapper.deleteMoAlarmLogByIds(ids);
    }

    /**
     * 删除报警记录信息
     * 
     * @param id 报警记录主键
     * @return 结果
     */
    @Override
    public int deleteMoAlarmLogById(Long id)
    {
        return moAlarmLogMapper.deleteMoAlarmLogById(id);
    }
}
